import dash
from dash import dcc, html
import plotly.graph_objects as go
from models import db, Organization
from sqlalchemy import func
import pandas as pd
import numpy as np



# 创建中间地图面板
def create_map_panel():
    return html.Div([
        html.Div([
            # 添加地图切换控件
            # html.Div([
            #     dcc.RadioItems(
            #         id='map-type-selector',
            #         options=[
            #             {'label': '静态地图', 'value': 'static'},
            #             {'label': '交互地图', 'value': 'interactive'}
            #         ],
            #         value='static',  # 默认选择静态地图
            #         labelStyle={'display': 'inline-block', 'marginRight': '10px', 'color': 'white', 'fontSize': '12px'},
            #         style={'textAlign': 'center', 'marginBottom': '3px', 'marginTop': '5px'}
            #     ),
            # ]),
            
            # 静态地图 - 默认显示
            html.Div([
                html.Img(
                    src='/static/map/maphuangpu.png',
                    style={"width": "95%", "height": "auto", "maxHeight": "calc(100vh - 70px)", "objectFit": "contain"}
                )
            ], id='static-map-container', style={"textAlign": "center", "height": "calc(100vh - 70px)"}),
            
            # 交互地图 - 初始隐藏
            # html.Div([
            #     # 百度地图iframe
            #     html.Iframe(
            #         src="https://map.baidu.com/search/%E4%B8%8A%E6%B5%B7%E5%B8%82/@13523265.74,3641163.57,12z?querytype=s&da_src=shareurl&wd=%E4%B8%8A%E6%B5%B7%E5%B8%82&c=289&src=0&pn=0&sug=0&l=13&b=(13511991.62,3631165.11;13534539.86,3651161.91)&from=webmap&biz_forward=%7B%22scaler%22:2,%22styles%22:%22pl%22%7D&device_ratio=2",
            #         style={"width": "95%", "height": "calc(100vh - 70px)", "border": "none"}
            #     )
            # ], id='interactive-map-container', style={'display': 'none', "textAlign": "center"}),
        ], className="panel-content", style={"padding": "0", "height": "100%"})
    ], className="dashboard-panel", style={"height": "100vh", "backgroundColor": "#001f3f"})






